Skip to content

chore: default spanner mysql config#2383

Merged
taddes merged 8 commits into
masterfrom
chore/default-spanner-mysql-config-STOR-477
Jun 26, 2026
Merged

chore: default spanner mysql config#2383
taddes merged 8 commits into
masterfrom
chore/default-spanner-mysql-config-STOR-477

Conversation

@taddes

@taddes taddes commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Description

Attempt to configure Spanner and MySQL for easy "out-of-the-box" runs.

One-shot stand-alone install

Adds committed, build-from-source docker compose files plus make targets so
a complete server (databases included) comes up in a single command, with no
manual database setup:

Backend Make target Compose file
MySQL make docker_oneshot_mysql docker/docker-compose.one-shot.mysql.yaml
PostgreSQL make docker_oneshot_postgres docker/docker-compose.one-shot.postgres.yaml
Spanner (emulator, local dev only) make docker_oneshot_spanner docker/docker-compose.one-shot.spanner.yaml
make docker_oneshot_mysql
curl http://localhost:8000/__heartbeat__   # -> {"status":"Ok",...}

Each has a matching _stop target. Schema migrations and node bootstrap run at
startup; the Spanner recipe provisions the emulator schema via a one-time setup
container. The docs (how-to-run-with-docker.md) now reference these committed
files instead of duplicating the YAML.

All three were verified end-to-end (full build → healthy → /__heartbeat__
returns 200).

Issue(s)

Closes STOR-477.

@taddes taddes self-assigned this Jun 10, 2026
@taddes taddes changed the title [WIP] chore: default spanner mysql config chore: default spanner mysql config Jun 17, 2026
@taddes taddes force-pushed the chore/default-spanner-mysql-config-STOR-477 branch from 1a81651 to 48461df Compare June 17, 2026 20:37
@taddes taddes marked this pull request as ready for review June 18, 2026 00:30
@taddes taddes force-pushed the chore/default-spanner-mysql-config-STOR-477 branch 2 times, most recently from 093b5d3 to 3abc6aa Compare June 23, 2026 17:03
taddes added 6 commits June 23, 2026 13:04
…anner

Provide ready-to-edit, fully-annotated example configs for the two standard
builds. local.example.toml is now a documented MySQL defaut local.example.spanner.toml is a new template for the production
Spanner syncstorage + MySQL tokenserver.

Each setting notes its purpose, default, and backend relevance, and the
REQUIRED values a user must edit are called out explicitly.

Closes STOR-477
Add doc comments to the previously-undocumented public Settings fields
(host/port, statsd host/port, human_logs, pool size, quota toggles,
spanner_emulator_host, enabled, statsd_label) so the structs are the source of
truth for configuration defaults. Documentation only; no behavior change.

Closes STOR-477
Add a short How-To page describing the out-of-the-box configuration for the
standard MySQL and Spanner builds, the minimum required settings, and where the
full reference lives.

Add a one-shot MySQL docker compose recipe (DB + server, migrations applied
automatically, sync-1.5 service + node bootstrapped) so the stack comes up ready
to serve. The primary recipe builds the image from source (works from a
checkout with no published tag); an alternative uses a published image, noting
that images are tagged by commit SHA with no `latest` tag, so SYNCSERVER_VERSION
must be pinned. Register the new page in the book summary and How-To index.

Closes STOR-477
A merge left a stale settings block in the MySQL example config that
re-declared syncstorage.enabled/database_url/enable_quota and
limits.max_total_records, producing duplicate TOML keys and a parse failure
(`Cannot overwrite a value`). Remove the stale block, keeping the single
annotated definitions so the template parses and can be copied to local.toml.

Closes STOR-477
Use 9984 as the example syncstorage.limits.max_total_records value.

Closes STOR-477
The one-shot install recipes previously existed only as copy-paste YAML in
the docs, so the out-of-box install required pasting YAML into a file before
running docker compose. Promote them to committed, build-from-source compose
files for MySQL, PostgreSQL, and the Spanner emulator, each with a make
target (docker_oneshot_<backend> / _stop), so a working server comes up in a
single command with no manual database setup.

Consolidate the docs to reference the committed files instead of duplicating
the YAML, keeping the compose files as the single source of truth.

Closes STOR-477
- "8000:8000"
environment:
SYNC_HOST: "0.0.0.0"
SYNC_PORT: "8000"

@pjenvey pjenvey Jun 23, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a change in all the composes here -- as this is referenced later in INIT_NODE_URL

Suggested change
SYNC_PORT: "8000"
SYNC_PORT: "${SYNC_PORT:-8000}"

Now that I look I see our documentation has the same mistake (want to fix it there as well?) https://mozilla-services.github.io/syncstorage-rs/how-to/how-to-run-with-docker.html

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx 👍

services:
syncserver:
image: ghcr.io/mozilla-services/syncstorage-rs/syncserver-postgres:${SYNCSERVER_VERSION:-latest}
image: ghcr.io/mozilla-services/syncstorage-rs/syncstorage-rs-mysql:${SYNCSERVER_VERSION:?set SYNCSERVER_VERSION to a published tag}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason this switched to mysql? Even though it's just an example I think we want to encourage postgres as much as possible over mysql

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I think this just reflects the example in the docs, nevermind

condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/__heartbeat__"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test: ["CMD", "curl", "-f", "http://localhost:8000/__heartbeat__"]
test: ["CMD", "curl", "-f", "http://localhost:${SYNC_PORT:-8000}/__heartbeat__"]

@taddes taddes requested a review from pjenvey June 24, 2026 21:14
@taddes taddes merged commit 521013d into master Jun 26, 2026
24 checks passed
@taddes taddes deleted the chore/default-spanner-mysql-config-STOR-477 branch June 26, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants